package org.korosoft.rusalad.syncnrun.command;

import org.korosoft.rusalad.syncnrun.messaging.Messenger;

import java.io.IOException;

/**
 * Syncnrun "ping" RPC command.
 *
 * @author Dmitry Korotkov
 * @since 1.0
 */
public class PingCmd implements Command<PingCmd.PingAnswer> {

    @Override
    public PingCmd.PingAnswer execute(Messenger messenger) throws IOException {
        return new PingAnswer();
    }

    @Override
    public String toString() {
        return "Ping";
    }

    public class PingAnswer implements Answer {
        @Override
        public String toString() {
            return "Pong";
        }
    }
}
